;	Schitivaet kod simvola s klaviaturi
;	-----------------------------------
; Vihod: AL - kod ASCII simvola (0 - upravlyauschii simvol)
;	 AH - skan-kod simvola
Read_byte:
	mov ah,0
	int 16h
	ret

Read_byte_hex:
	push bx
	mov si,0h
	mov bx,0h
	call Read_digit_hex
	mov si,bx
	shl si,4
	call Read_digit_hex
	add si,bx
	pop bx
	ret

Read_digit_hex:
	push ax
	push dx
.C:	mov ah,8h
	int 21h
	mov dl,al
	cmp al,30h
	jb .M
	cmp al,39h
	ja .N
	sub al,30h
	clc
	jmp .K
.N:	cmp al,41h
	jb .M
	cmp al,46h
	ja .M
	sub al,37h
	clc
	jmp .K
.M:	stc
.K:	jc .C
	mov bl,al
	mov ah,2h
	int 21h
	pop dx
	pop ax
	ret

